<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML>
<html>
<head>
<title>My JSP 'askQuestion.jsp' starting page</title>

<link href="img/ico.ico" rel="shortcut icon">

<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<script type="text/javascript" src="js/jquery-min.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<style type="text/css">
.formOfDiv{
	padding-left:10%;
}
</style>
</head>

<body>

	<%@ include file="pagetop/pagetitle.jsp"%>
	<div class="pagetitle">
	<hr/>
		<i class="icon-home"></i><a href="index.action">回主页</a>&gt;&gt;&gt;&gt;&gt;<i class="icon-question-sign"></i>提问新问题
	</div>
	<br/>
	<div class="formOfDiv">
		<form action="saveQuestion.action">
			<i class="icon-comment"></i>问题：<input type="text" name="questionname" /><br />
			问题类型：
			<select name="questiontypeId">
				<option>---请选择问题的类型---</option>
				<c:forEach var="questiontype" items="${questiontypesList}">
					<option  value="${questiontype.id}">${questiontype.name}</option>
				</c:forEach>
			</select>
		</form>
		<input type="button" value="提问" />
	</div>
</body>
<script type="text/javascript">
	$(function() {
		$("input[type='button']").click(function() {
			if ($("input[name='questionname']").val() == null||$("input[name='questionname']").val()=="") {
				confirm("您还没有输入任何东西！");
				return false;
			} else if($("select[name='questiontypeId']").val()=='---请选择问题的类型---'){
				alert("请选择问题类型！");
				return false;
			}
			//$.post("saveQuestion.action",{"questionname":$("input[name='questionname']").val()});

			$("form").submit();
		});
	});
</script>

</html>
